#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
class Shape {
public:
	Shape(){}
	virtual void area() {
	}
};
class Circle :public Shape {
protected:
	double r;
public:
	Circle(double _r):r(_r){}
	virtual void area() {
		double s = 3.14 * pow(r, 2);
		cout << fixed << setprecision(2) << s << endl;
	}
};
class Square :public Shape {
protected:
	double l;
public:
	Square(double _l):l(_l){}
	virtual void area() {
		double s = pow(l, 2);
		cout << fixed << setprecision(2) << s << endl;
	}
};
class Rectangle :public Shape {
protected:
	double l1;
	double l2;
public:
	Rectangle(double _l1,double _l2):l1(_l1),l2(_l2){}
	virtual void area() {
		double s = l1 * l2;
		cout << fixed << setprecision(2) << s << endl;
	}
};
void fun(Shape& a) {
	a.area();
}
int main()
{
	int t;
	cin >> t;
	double l1, l2;
	Shape** p = new Shape*[t];
	for (int i = 0; i < t; i++) {
		int j = 0;
		cin >> l1;
		Circle c(l1);
		p[j++] = &c;
		cin >> l1;
		Square s(l1);
		p[j++] = &s;
		cin >> l1 >> l2;
		Rectangle r(l1, l2);
		p[j++] = &r;
		for (int k = 0; k < j; k++) {
			p[k]->area();
		}
	}
	return 0;
}